package jp.ac.u_tokyo.dch.util.common;

import java.util.List;
import java.util.Map;

import jp.ac.u_tokyo.dch.core.db.DBConnection;
import jp.ac.u_tokyo.dch.dao.data.DataDao;
import jp.ac.u_tokyo.dch.model.db.Data;
import jp.ac.u_tokyo.dch.util.PageUtil;

/**
 * @version 1.1
 */
public class DataPageUtil extends PageUtil<Data> {

	/**
	* DBコネクションオブジェクト
	 */
	private DBConnection dbconn;
	/**
	 * オブジェクト生成者
	 * @param dbconn
	 */
	public DataPageUtil(DBConnection conn) {
		this.dbconn = conn;
	}
	@Override
	protected int getSearchResultCnt(Map<String, String> searchKeyMap) throws Exception {

		DataDao dao = new DataDao(dbconn);

		return dao.getSearchResultCnt(searchKeyMap);
	}

	@Override
	protected List<Data> getSearchResultList(int start, int viewPageCnt, Map<String, String> searchKeyMap) throws Exception {

		DataDao dao = new DataDao(dbconn);

		return dao.getSearchResult(start, viewPageCnt, searchKeyMap);
	}


}
